import Cookies from 'js-cookie'

const TokenKey = 'humen_pollution'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  var now = new Date()
  now.setHours(now.getHours() + 2) // 两小时后cookie过期
  return Cookies.set(TokenKey, token, { expires: now })
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
